package net.zoneland.knowledge.enums;

import com.branchitech.utils.enums.EnumExtend;
import com.branchitech.utils.enums.EnumUtils;

/**
 * 会议状态.
 * 会议状态：1--草稿，2-带召开，3-会议中，4-待归档，5-审核中，6-会签中，7-已归档
 * @author zx
 */
public enum MeetingStatusEnum implements EnumExtend {
    DRAFT(1, "草稿","DRAFT"),
    TAKEA(2,"待召开","TAKEA"),
    MEETING(3,"会议中","MEETING"),
    TO_ARCHIVE(4,"待归档","TO_ARCHIVE"),
    AUDIT(5,"审核中","AUDIT"),
    SIGIN(6,"会签中","SIGIN"),
    DONE_ARCHIVE(7,"已归档","DONE_ARCHIVE")
    ;

    /**
     * 整数key.
     */
    private final transient int intKey;

    /**
     * 字符串key.
     */
    private final transient String stringKey;

    /**
     * 显示标签.
     */
    private final transient String label;

    /**
     * @param intKey    整数key
     * @param stringKey 字符串key
     * @param label     标签
     */
    MeetingStatusEnum(final int intKey, final String stringKey, final String label) {
        this.intKey = intKey;
        this.stringKey = stringKey;
        this.label = label;
    }

    /**
     * 通过枚举字符串关键字获取枚举.
     *
     * @param key 枚举字符串关键字
     * @return 枚举字符串关键字对应的枚举常量实例
     */
    public static MeetingStatusEnum getByStringKey(final String key) {
        return EnumUtils.getByStringKey(MeetingStatusEnum.class, key);
    }

    /**
     * 通过枚举关键字获取枚举.
     *
     * @param index 枚举关键字
     * @return 枚举字符串关键字对应的枚举常量实例
     */
    public static MeetingStatusEnum getByIntKey(final int index) {
        return EnumUtils.getByIntKey(MeetingStatusEnum.class, index);
    }

    public static String getByIntKey(final String index) {
        return getByIntKey(Integer.valueOf(index)).getStringKey();
    }

    @Override
    public int getIntKey() {
        return intKey;
    }

    @Override
    public String getStringKey() {
        return stringKey;
    }

    @Override
    public String getLabel() {
        return label;
    }
}
